## R Code for Study 2, MTurk Data ##

# Load Study2_MTurkData.csv #
ExpData <- read.table(file.choose(), header = TRUE, sep = ",")

ExpData$TransExp <- 0
ExpData$TransExp[!is.na(ExpData$Q8)] <- 1
ExpData$TransExp[!is.na(ExpData$Q29)] <- 1
table(ExpData$TransExp)

ExpData <- ExpData[ExpData$TransExp == 1, ]

##

# Code for Attitude and agree/disagree
ExpData$TransAttitude <- (ifelse(!is.na(ExpData$Q8), ExpData$Q8,
                                 ExpData$Q29))
table(ExpData$TransAttitude)

ExpData$TransAgree <- ifelse(ExpData$TransAttitude < 4, 1, 0)
table(ExpData$TransAgree)

# Code treatment (1 = episodic, 0 = thematic)
ExpData$TransTreat <- ifelse(!is.na(ExpData$Q8), 1, 0)
table(ExpData$TransTreat)

# Extremity coded high numbers if extreme #
ExpData$TransExtremity <- abs(4 - ExpData$TransAttitude)
table(ExpData$TransExtremity)
ExpData$TransExtremity <- ExpData$TransExtremity/3
table(ExpData$TransExtremity)

# Importance coded high numbers if important
ExpData$TransImportance1 <- ifelse(!is.na(ExpData$Q10), ExpData$Q10,
                                   ExpData$Q30)
ExpData$TransImportance <- 5 - ExpData$TransImportance1
table(ExpData$TransImportance)
ExpData$TransImportance <- ExpData$TransImportance/4
table(ExpData$TransImportance)

# Personal Salience coded high numbers if decision affects you 
ExpData$TransPersonalSalience <- 5 - ExpData$Q11
table(ExpData$TransPersonalSalience)
ExpData$TransPersonalSalience <- ExpData$TransPersonalSalience/4
table(ExpData$TransPersonalSalience)

# Moral Conviction 1 -- High numbers indicate moralized
ExpData$TransMoral1 <- 5 - ExpData$Q12
table(ExpData$TransMoral1)

# Moral Conviction 2 -- High numbers indicate moralized
ExpData$TransMoral2 <- 5 - ExpData$Q13
table(ExpData$TransMoral2)

# Full Moral, High numbers means high moral
ExpData$TransMoralFull <- ExpData$TransMoral1 + ExpData$TransMoral2
table(ExpData$TransMoralFull)
ExpData$TransMoralFull <- ExpData$TransMoralFull/8
table(ExpData$TransMoralFull)

###

cor(ExpData$TransMoralFull, ExpData$TransPersonalSalience, use = "pairwise.complete.obs")
cor(ExpData$TransMoralFull, ExpData$TransImportance, use = "pairwise.complete.obs")
cor(ExpData$TransMoralFull, ExpData$TransExtremity, use = "pairwise.complete.obs")

# Code for emotion
ExpData$Anger <- ExpData$Q29_1
ExpData$Disgust <- ExpData$Q29_2
ExpData$Sadness <- ExpData$Q29_3
ExpData$Anxiety <- ExpData$Q29_4

emodat <- c("Anger", "Disgust",
            "Sadness", "Anxiety")

emodata <- ExpData[emodat]

emodata <- na.omit(emodata)

# Cronbach's alpha
library(psych)
alpha(emodata)

ExpData$AllEmo <- ExpData$Anger + ExpData$Disgust + 
  ExpData$Sadness + ExpData$Anxiety
table(ExpData$AllEmo)
ExpData$AllEmo <- ExpData$AllEmo - 4
table(ExpData$AllEmo)
ExpData$AllEmo <- ExpData$AllEmo/16
table(ExpData$AllEmo)

# Fit SUR Model

library(systemfit)

e1 <- TransMoralFull ~ TransTreat
e2 <- TransPersonalSalience ~ TransTreat
e3 <- TransImportance ~ TransTreat
e4 <- TransExtremity ~ TransTreat

SURVars <- c("TransMoralFull", "TransImportance", "TransPersonalSalience",
             "TransExtremity", "TransTreat")

ExpData1 <- ExpData[SURVars]
ExpData1 <- na.omit(ExpData1)

fitsur <- systemfit(list(Moral = e1, PerSal = e2, Imp = e3, Ext = e4), 
                    data=ExpData1)
summary(fitsur)

library(car)
rest1 <- "Moral_TransTreat - PerSal_TransTreat"
linearHypothesis(fitsur, rest1, test = "F")

rest2 <- "Moral_TransTreat - Imp_TransTreat"
linearHypothesis(fitsur, rest2, test = "F")

rest3 <- "Moral_TransTreat - Ext_TransTreat"
linearHypothesis(fitsur, rest3, test = "F")

## Treatment effects conditioned on agree/disagree (supp material) ##

e5 <- TransMoralFull ~ TransTreat*TransAgree
e6 <- TransPersonalSalience ~ TransTreat*TransAgree
e7 <- TransImportance ~ TransTreat*TransAgree
e8 <- TransExtremity ~ TransTreat*TransAgree

SURVars2 <- c("TransMoralFull", "TransImportance", "TransPersonalSalience",
              "TransExtremity", "TransTreat", "TransAgree")

ExpData2 <- ExpData[SURVars2]
ExpData3 <- na.omit(ExpData2)

fitsur2 <- systemfit(list(Moral = e5, PerSal = e6, Imp = e7, Ext = e8), 
                     data=ExpData3)
summary(fitsur2)

# Coding for mediation models #

ExpData$Dem <- ifelse(ExpData$Q20.1 == 1, 1, 0)
ExpData$Rep <- ifelse(ExpData$Q20.1 == 2, 1, 0)
table(ExpData$Dem)
table(ExpData$Rep)

ExpData$Ideol <- ExpData$Q24
table(ExpData$Ideol)

ExpData$Female <- ifelse(ExpData$Q25 == 2, 1, 0)
table(ExpData$Female)

ExpData$Age <- ExpData$Q26
table(ExpData$Age)

MedVars <- c("TransTreat", "TransMoralFull", "AllEmo","TransExtremity",
             "TransImportance", "TransPersonalSalience", "Dem",
             "Rep", "Ideol", "Female", "Age")

MedData <- ExpData[MedVars]
MedData <- na.omit(MedData)

library(mediation)
set.seed(12345)
med.fit.emo <- lm(AllEmo ~ TransTreat + Dem + Rep + Ideol + Female + Age, 
                  data = MedData)
out.fit.emo <- lm(TransMoralFull ~ AllEmo + TransTreat + Dem + Rep + 
                    Ideol + Age + TransExtremity + TransImportance +
                    TransPersonalSalience, data = MedData)
med.out.emo <- mediate(med.fit.emo, out.fit.emo, treat = "TransTreat",
                       mediator = "AllEmo", robustSE = TRUE, 
                       sims = 2000)
summary(med.out.emo)

set.seed(12345)
med.fit.emo <- lm(AllEmo ~ TransTreat + Dem + Rep + Ideol + Female + Age, 
                  data = MedData)
out.fit.emo <- lm(TransExtremity ~ AllEmo + TransTreat + Dem + Rep + 
                    Ideol + Age + TransMoralFull + TransImportance +
                    TransPersonalSalience, data = MedData)
med.out.emo <- mediate(med.fit.emo, out.fit.emo, treat = "TransTreat",
                       mediator = "AllEmo", robustSE = TRUE, 
                       sims = 2000)
summary(med.out.emo)

set.seed(12345)
med.fit.emo <- lm(AllEmo ~ TransTreat + Dem + Rep + Ideol + Female + Age, 
                  data = MedData)
out.fit.emo <- lm(TransImportance ~ AllEmo + TransTreat + Dem + Rep + 
                    Ideol + Age + TransExtremity + TransMoralFull +
                    TransPersonalSalience, data = MedData)
med.out.emo <- mediate(med.fit.emo, out.fit.emo, treat = "TransTreat",
                       mediator = "AllEmo", robustSE = TRUE, 
                       sims = 2000)
summary(med.out.emo)

set.seed(12345)
med.fit.emo <- lm(AllEmo ~ TransTreat + Dem + Rep + Ideol + Female + Age, 
                  data = MedData)
out.fit.emo <- lm(TransPersonalSalience ~ AllEmo + TransTreat + Dem + Rep + 
                    Ideol + Age + TransExtremity + TransImportance +
                    TransMoralFull, data = MedData)
med.out.emo <- mediate(med.fit.emo, out.fit.emo, treat = "TransTreat",
                       mediator = "AllEmo", robustSE = TRUE, 
                       sims = 2000)
summary(med.out.emo)

# Multiple mediators (supp analysis) #

MedVars <- c("TransTreat", "TransMoralFull", "AllEmo","TransExtremity",
             "TransImportance", "TransPersonalSalience", "Dem",
             "Rep", "Ideol", "Female", "Age", "Anger", "Disgust",
             "Sadness", "Anxiety")

MedData <- ExpData[MedVars]
MedData <- na.omit(MedData)

### Moral Conviction ###

# Anger #
set.seed(12345)
m.med_anger_moralconv95 <- multimed(outcome = "TransMoralFull", med.main = "Anger",
                                    med.alt = c("Disgust", "Sadness", "Anxiety"),
                                    treat = "TransTreat",
                                    covariates = c("TransExtremity", "TransImportance",
                                                   "TransPersonalSalience",
                                                   "Dem", "Rep", "Ideol", 
                                                   "Female", "Age"),
                                    data = MedData, sims = 2000,
                                    conf.level = .95)
summary(m.med_anger_moralconv95)

set.seed(12345)
m.med_anger_moralconv99 <- multimed(outcome = "TransMoralFull", med.main = "Anger",
                                    med.alt = c("Disgust", "Sadness", "Anxiety"),
                                    treat = "TransTreat",
                                    covariates = c("TransExtremity", "TransImportance",
                                                   "TransPersonalSalience",
                                                   "Dem", "Rep", "Ideol", 
                                                   "Female", "Age"),
                                    data = MedData, sims = 2000,
                                    conf.level = .99)
summary(m.med_anger_moralconv99)

# Disgust #
set.seed(12345)
m.med_disgust_moralconv95 <- multimed(outcome = "TransMoralFull", med.main = "Disgust",
                                      med.alt = c("Anger", "Sadness", "Anxiety"),
                                      treat = "TransTreat",
                                      covariates = c("TransExtremity", "TransImportance",
                                                     "TransPersonalSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .95)
summary(m.med_disgust_moralconv95)

set.seed(12345)
m.med_disgust_moralconv99 <- multimed(outcome = "TransMoralFull", med.main = "Disgust",
                                      med.alt = c("Anger", "Sadness", "Anxiety"),
                                      treat = "TransTreat",
                                      covariates = c("TransExtremity", "TransImportance",
                                                     "TransPersonalSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .99)
summary(m.med_disgust_moralconv99)

# Anxiety #
set.seed(12345)
m.med_anxiety_moralconv95 <- multimed(outcome = "TransMoralFull", med.main = "Anxiety",
                                      med.alt = c("Anger", "Sadness", "Disgust"),
                                      treat = "TransTreat",
                                      covariates = c("TransExtremity", "TransImportance",
                                                     "TransPersonalSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .95)
summary(m.med_anxiety_moralconv95)

set.seed(12345)
m.med_anxiety_moralconv99 <- multimed(outcome = "TransMoralFull", med.main = "Anxiety",
                                      med.alt = c("Anger", "Sadness", "Disgust"),
                                      treat = "TransTreat",
                                      covariates = c("TransExtremity", "TransImportance",
                                                     "TransPersonalSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .99)
summary(m.med_anxiety_moralconv99)

# Sadness #
set.seed(12345)
m.med_sadness_moralconv95 <- multimed(outcome = "TransMoralFull", med.main = "Sadness",
                                      med.alt = c("Anger", "Anxiety", "Disgust"),
                                      treat = "TransTreat",
                                      covariates = c("TransExtremity", "TransImportance",
                                                     "TransPersonalSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .95)
summary(m.med_sadness_moralconv95)

set.seed(12345)
m.med_sadness_moralconv99 <- multimed(outcome = "TransMoralFull", med.main = "Sadness",
                                      med.alt = c("Anger", "Anxiety", "Disgust"),
                                      treat = "TransTreat",
                                      covariates = c("TransExtremity", "TransImportance",
                                                     "TransPersonalSalience",
                                                     "Dem", "Rep", "Ideol", 
                                                     "Female", "Age"),
                                      data = MedData, sims = 2000,
                                      conf.level = .99)
summary(m.med_sadness_moralconv99)


### Personal Salience ###

# Anger #
set.seed(12345)
m.med_anger_persal95 <- multimed(outcome = "TransPersonalSalience", med.main = "Anger",
                                 med.alt = c("Disgust", "Sadness", "Anxiety"),
                                 treat = "TransTreat",
                                 covariates = c("TransExtremity", "TransImportance",
                                                "TransMoralFull",
                                                "Dem", "Rep", "Ideol", 
                                                "Female", "Age"),
                                 data = MedData, sims = 2000,
                                 conf.level = .95)
summary(m.med_anger_persal95)

set.seed(12345)
m.med_anger_persal99 <- multimed(outcome = "TransPersonalSalience", med.main = "Anger",
                                 med.alt = c("Disgust", "Sadness", "Anxiety"),
                                 treat = "TransTreat",
                                 covariates = c("TransExtremity", "TransImportance",
                                                "TransMoralFull",
                                                "Dem", "Rep", "Ideol", 
                                                "Female", "Age"),
                                 data = MedData, sims = 2000,
                                 conf.level = .99)
summary(m.med_anger_persal99)

# Disgust #
set.seed(12345)
m.med_disgust_persal95 <- multimed(outcome = "TransPersonalSalience", med.main = "Disgust",
                                   med.alt = c("Anger", "Sadness", "Anxiety"),
                                   treat = "TransTreat",
                                   covariates = c("TransExtremity", "TransImportance",
                                                  "TransMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .95)
summary(m.med_disgust_persal95)

set.seed(12345)
m.med_disgust_persal99 <- multimed(outcome = "TransPersonalSalience", med.main = "Disgust",
                                   med.alt = c("Anger", "Sadness", "Anxiety"),
                                   treat = "TransTreat",
                                   covariates = c("TransExtremity", "TransImportance",
                                                  "TransMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .99)
summary(m.med_disgust_persal99)

# Anxiety #
set.seed(12345)
m.med_anxiety_persal95 <- multimed(outcome = "TransPersonalSalience", med.main = "Anxiety",
                                   med.alt = c("Anger", "Sadness", "Disgust"),
                                   treat = "TransTreat",
                                   covariates = c("TransExtremity", "TransImportance",
                                                  "TransMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .95)
summary(m.med_anxiety_persal95)

set.seed(12345)
m.med_anxiety_persal99 <- multimed(outcome = "TransPersonalSalience", med.main = "Anxiety",
                                   med.alt = c("Anger", "Sadness", "Disgust"),
                                   treat = "TransTreat",
                                   covariates = c("TransExtremity", "TransImportance",
                                                  "TransMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .99)
summary(m.med_anxiety_persal99)

# Sadness #
set.seed(12345)
m.med_sadness_persal95 <- multimed(outcome = "TransPersonalSalience", med.main = "Sadness",
                                   med.alt = c("Anger", "Anxiety", "Disgust"),
                                   treat = "TransTreat",
                                   covariates = c("TransExtremity", "TransImportance",
                                                  "TransMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .95)
summary(m.med_sadness_persal95)

set.seed(12345)
m.med_sadness_persal99 <- multimed(outcome = "TransPersonalSalience", med.main = "Sadness",
                                   med.alt = c("Anger", "Anxiety", "Disgust"),
                                   treat = "TransTreat",
                                   covariates = c("TransExtremity", "TransImportance",
                                                  "TransMoralFull",
                                                  "Dem", "Rep", "Ideol", 
                                                  "Female", "Age"),
                                   data = MedData, sims = 2000,
                                   conf.level = .99)
summary(m.med_sadness_persal99)


### Attitude Importance ###

# Anger #
set.seed(12345)
m.med_anger_imp95 <- multimed(outcome = "TransImportance", med.main = "Anger",
                              med.alt = c("Disgust", "Sadness", "Anxiety"),
                              treat = "TransTreat",
                              covariates = c("TransExtremity", "TransPersonalSalience",
                                             "TransMoralFull",
                                             "Dem", "Rep", "Ideol", 
                                             "Female", "Age"),
                              data = MedData, sims = 2000,
                              conf.level = .95)
summary(m.med_anger_imp95)

set.seed(12345)
m.med_anger_imp99 <- multimed(outcome = "TransImportance", med.main = "Anger",
                              med.alt = c("Disgust", "Sadness", "Anxiety"),
                              treat = "TransTreat",
                              covariates = c("TransExtremity", "TransPersonalSalience",
                                             "TransMoralFull",
                                             "Dem", "Rep", "Ideol", 
                                             "Female", "Age"),
                              data = MedData, sims = 2000,
                              conf.level = .99)
summary(m.med_anger_imp99)

# Disgust #
set.seed(12345)
m.med_disgust_imp95 <- multimed(outcome = "TransImportance", med.main = "Disgust",
                                med.alt = c("Anger", "Sadness", "Anxiety"),
                                treat = "TransTreat",
                                covariates = c("TransExtremity", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_disgust_imp95)

set.seed(12345)
m.med_disgust_imp99 <- multimed(outcome = "TransImportance", med.main = "Disgust",
                                med.alt = c("Anger", "Sadness", "Anxiety"),
                                treat = "TransTreat",
                                covariates = c("TransExtremity", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_disgust_imp99)

# Anxiety #
set.seed(12345)
m.med_anxiety_imp95 <- multimed(outcome = "TransImportance", med.main = "Anxiety",
                                med.alt = c("Anger", "Sadness", "Disgust"),
                                treat = "TransTreat",
                                covariates = c("TransExtremity", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_anxiety_imp95)

set.seed(12345)
m.med_anxiety_imp99 <- multimed(outcome = "TransImportance", med.main = "Anxiety",
                                med.alt = c("Anger", "Sadness", "Disgust"),
                                treat = "TransTreat",
                                covariates = c("TransExtremity", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_anxiety_imp99)

# Sadness #
set.seed(12345)
m.med_sadness_imp95 <- multimed(outcome = "TransImportance", med.main = "Sadness",
                                med.alt = c("Anger", "Anxiety", "Disgust"),
                                treat = "TransTreat",
                                covariates = c("TransExtremity", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_sadness_imp95)

set.seed(12345)
m.med_sadness_imp99 <- multimed(outcome = "TransImportance", med.main = "Sadness",
                                med.alt = c("Anger", "Anxiety", "Disgust"),
                                treat = "TransTreat",
                                covariates = c("TransExtremity", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_sadness_imp99)


# Attitude Extremity #

# Anger #
set.seed(12345)
m.med_anger_ext95 <- multimed(outcome = "TransExtremity", med.main = "Anger",
                              med.alt = c("Disgust", "Sadness", "Anxiety"),
                              treat = "TransTreat",
                              covariates = c("TransImportance", "TransPersonalSalience",
                                             "TransMoralFull",
                                             "Dem", "Rep", "Ideol", 
                                             "Female", "Age"),
                              data = MedData, sims = 2000,
                              conf.level = .95)
summary(m.med_anger_ext95)

set.seed(12345)
m.med_anger_ext99 <- multimed(outcome = "TransExtremity", med.main = "Anger",
                              med.alt = c("Disgust", "Sadness", "Anxiety"),
                              treat = "TransTreat",
                              covariates = c("TransImportance", "TransPersonalSalience",
                                             "TransMoralFull",
                                             "Dem", "Rep", "Ideol", 
                                             "Female", "Age"),
                              data = MedData, sims = 2000,
                              conf.level = .99)
summary(m.med_anger_ext99)

# Disgust #
set.seed(12345)
m.med_disgust_ext95 <- multimed(outcome = "TransExtremity", med.main = "Disgust",
                                med.alt = c("Anger", "Sadness", "Anxiety"),
                                treat = "TransTreat",
                                covariates = c("TransImportance", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_disgust_ext95)

set.seed(12345)
m.med_disgust_ext99 <- multimed(outcome = "TransExtremity", med.main = "Disgust",
                                med.alt = c("Anger", "Sadness", "Anxiety"),
                                treat = "TransTreat",
                                covariates = c("TransImportance", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_disgust_ext99)

# Anxiety #
set.seed(12345)
m.med_anxiety_ext95 <- multimed(outcome = "TransExtremity", med.main = "Anxiety",
                                med.alt = c("Anger", "Sadness", "Disgust"),
                                treat = "TransTreat",
                                covariates = c("TransImportance", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_anxiety_ext95)

set.seed(12345)
m.med_anxiety_ext99 <- multimed(outcome = "TransExtremity", med.main = "Anxiety",
                                med.alt = c("Anger", "Sadness", "Disgust"),
                                treat = "TransTreat",
                                covariates = c("TransImportance", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_anxiety_ext99)

# Sadness #
set.seed(12345)
m.med_sadness_ext95 <- multimed(outcome = "TransExtremity", med.main = "Sadness",
                                med.alt = c("Anger", "Anxiety", "Disgust"),
                                treat = "TransTreat",
                                covariates = c("TransImportance", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .95)
summary(m.med_sadness_ext95)

set.seed(12345)
m.med_sadness_ext99 <- multimed(outcome = "TransExtremity", med.main = "Sadness",
                                med.alt = c("Anger", "Anxiety", "Disgust"),
                                treat = "TransTreat",
                                covariates = c("TransImportance", "TransPersonalSalience",
                                               "TransMoralFull",
                                               "Dem", "Rep", "Ideol", 
                                               "Female", "Age"),
                                data = MedData, sims = 2000,
                                conf.level = .99)
summary(m.med_sadness_ext99)

